var _openId;
var _shopId;
$(function() {
	_openId = getSSOpenId();
	_shopId = getIdByName("shopId");
});

function getSSOpenId() {
	var openId = null;
	openId = qmsk.getQueryValue("openId");
	if (qmsk.isNotEmpty(openId)) {
		return openId;
	}
	var code = qmsk.getQueryValue("code");
	if (qmsk.isEmpty(code)) {
		return null;
	}

	var response = qmsk.asynGet('../../../wechat/accessToken/' + code);
	if (response == null) {
		return null;
	}
	var openId = response.getValue("openId");
	if (qmsk.isEmpty(openId)) {
		alert("获取 openId 失败！");
		return null;
	}
	return openId;
}